Repository navigation
fix(web): correct account analytics and sync behavior - #288
NeerajCodz wants to merge 3 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0a431b8665
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| await clearLocalData(userId); | ||
| await signOut(); |
There was a problem hiding this comment.
Stop active sync before clearing sign-out data
When the user signs out while BrowserSyncProvider is syncing, clearLocalData can finish before an in-flight bootstrap or pull writes its response to IndexedDB. Signing out does not cancel those operations, which retain the user ID they started with, so they can repopulate finance records after this deletion and leave private data in the browser despite the sign-out guarantee. Coordinate shutdown of active sync before clearing, or perform a final clear after synchronization can no longer write.
Useful? React with 👍 / 👎.
| <Button | ||
| size="sm" | ||
| variant="outline" | ||
| disabled={resolvingConflict !== null} | ||
| onPress={() => void chooseConflict(conflict.id, 'local')} |
There was a problem hiding this comment.
Disable local conflict resolution during active sync
If “Keep this device” is pressed while a background sync is already running, conflict resolution creates a pending outbox entry and then calls flush(), but flush() immediately returns because its running guard is set. When the current sync has already passed syncOutbox, the chosen local version can remain pending until another sync trigger, and a subsequent pull in the current run can recreate the conflict. The existing sync sheet avoids this race by disabling these actions while isSyncing; this page should do the same.
Useful? React with 👍 / 👎.
| await clearLocalData(userId); | ||
| await signOut(); |
There was a problem hiding this comment.
Complete sign-out when local cleanup fails
If IndexedDB is unavailable, blocked, or fails while clearLocalData opens or commits its transaction, the exception jumps to this function’s catch before signOut() runs. The user therefore cannot terminate their authenticated session from this button precisely when browser storage is unhealthy, which is particularly risky on a shared browser. Local cleanup failure should be reported, but it must not prevent the authentication sign-out from being attempted.
Useful? React with 👍 / 👎.
| <div key={conflict.id} style={{ display: 'grid', gap: 8, paddingBlock: 8 }}> | ||
| <p style={{ margin: 0 }}> | ||
| {conflict.entityType} {conflict.recordId} has a local and cloud version. Choose which to keep. | ||
| </p> |
There was a problem hiding this comment.
Show both versions before resolving a conflict
For every sync conflict, this page displays only the entity type and record ID before offering destructive “Keep this device” and “Keep cloud” actions. Since conflict.localRecord and conflict.cloudRecord are available but never rendered, users cannot tell which name, amount, or other value each action will preserve and may overwrite the desired edit. Present the differing values, as the existing local sync sheet does, before allowing either resolution.
Useful? React with 👍 / 👎.
- Restore the account-filter condition and sync status title expression.
|
@codex review |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
- Apply the repository formatter to files flagged by CI.
Changes
Issues
Fixes #196
Fixes #198
Fixes #203
Fixes #267
Fixes #268
Fixes #269
Fixes #270
Fixes #279
Fixes #280
Fixes #283